/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package interfaces;

import entities.Article;
import entities.UserProject;
import java.util.List;
import javax.ejb.EJBException;
import javax.ejb.Local;

/**
 * EJB for UserProject entity
 *
 * @author Thibault
 */
@Local
public interface UserProjectInterface {

    /**
     * Add a new user in database.
     *
     * @param userProject the user to add at database.
     */
    public void createUserProject(UserProject userProject);

    /**
     * Find a UserProject using his identifiant
     *
     * @param id id of searching user.
     * @throws EJBException if user doesn't exist.
     * @return The user corresponding to id, throws <b>EJBException</b> if
     * doesn't exist.
     */
    public UserProject findById(long id) throws EJBException;

    /**
     * Find a user user his login and password.
     *
     * @param login login of searched user.
     * @param password password of searched user.
     * @return The corresponding user, throws <b>EJBException</b> if doesn't
     * exist.
     */
    public UserProject findUserByLoginAndPassword(String login, String password);

    /**
     * Delete an user from database.
     *
     * @throws EJBException if user id doesn't exist.
     * @param id Identifiant of user to delete.
     */
    public void removeUser(long id) throws EJBException;

    /**
     * Update an user from database.
     *
     * @param user the user to update.
     */
    public void updateUser(UserProject user);

    /**
     * Check if a mail is already use in database for an account.
     *
     * @param mail the mail address to check.
     * @return if mail is already in database return <b>true</b> else
     * <b>false</f>
     */
    public boolean isMailAlreadyUsed(String mail);
    
    /**
     * Find all items on which a user bids.
     * @param idUser the @id of the user.
     * @return A list of article.
     */
    public List<Article> getListAriticleWithBidForUser(long idUser);
}
